/**
 * @author light_dust_generator
 * @since 2021-06-30 11:44:50
 */
 <template>
   <qc-page-header @back="goBack"></qc-page-header>
   <a-card :bordered="false" :title="t('org.data-source.dataSourceCardTitle')">
     <template #extra>
       <qc-save-button @click="save"></qc-save-button>
     </template>
     <data-source-form ref="dataSourceFormRef" :dataSourceId="dataSourceId"></data-source-form>
   </a-card>
 </template>
 <script lang='ts'>
 import { computed, defineComponent, reactive, ref, toRefs } from "vue";
 import { useRouter } from "vue-router";
 import { useI18n } from "vue-i18n";
 import { dataSourceIndexPageUrl } from "./interface";
 import DataSourceForm from "./component/data-source-form.vue";
 export default defineComponent({
   components: {DataSourceForm},
   setup() {
     const { t } = useI18n();
     const dataSourceFormRef = ref();
     const router = useRouter();
     const formState = reactive({
       dataSourceId: router.currentRoute.value.params.id,
       save: () => dataSourceFormRef.value.onSubmit(),
       goBack: () => router.push({ path: dataSourceIndexPageUrl }),
     });
     return {
       t,
       dataSourceFormRef,
       ...toRefs(formState),
     };
   },
 });
 </script>